const state = {
  pagination: {
    default: {
      id: 0,
      total: 30,
      current: 1,
      size: 30,
    }
  },
  dict: {
    default: {
      STATUS: [
        {
          code: "enable",
          name: "enable",
          value: 1
        },
        {
          code: "disable",
          name: "disable",
          value: 0
        }
      ]
    },
    manage: {}
  }
}

const mutations = {
  SAVE_PAGINATION (state, pagination) {
    state.pagination[pagination.page] = pagination
  },
  SAVE_DICTMAP (state, merge) {
    state.dict[merge.module] = merge.dictMap
  }
}

const actions = {
  savePagination ({commit}, pagination) {
    commit('SAVE_PAGINATION', pagination)
  },
  saveDictMap ({commit}, merge) {
    commit('SAVE_DICTMAP', merge)
  }
}

export default {
  state,
  mutations,
  actions
}
